home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C64Software / JB.1520-5.B.SFX / 1520 sprite plot (.txt) next >
Commodore BASIC  |  1990-02-12  |  2KB  |  80 lines

  1. 0 REM**********************************
  2. 1 REM*** SPRITE PLOTTER FOR 1520 BY ***
  3. 2 REM***** (C) ALAN BROWN OCT '85 *****
  4. 3 REM**********************************
  5. 100 PRINT"[147]POKING IN MACHINE CODE"
  6. 110 FORI=16384TO16473:READA:POKEI,A:NEXT
  7. 120 S=1024:C=55296:CC=C
  8. 130 GOSUB590:GOSUB390            
  9. 140 CS=16466:X=0:Y=40:YY=0:CX=0
  10. 150 POKECS,0:BC=16471
  11. 160 HB=INT (SA/256):LB=SA-HB*256
  12. 170 POKE251,LB:POKE252,HB
  13. 180 REM
  14. 190 FORII=1TO21:POKE16467,3:SYS16384
  15. 200 BC=16471
  16. 210 IFPEEK(BC)=0THENBC=BC+1:XC=PEEK(BC):GOSUB440
  17. 220 XC=PEEK(BC):IFXC=0THEN270
  18. 230 GOSUB470
  19. 240 XC=PEEK(BC):IFXC=0THEN270
  20. 250 GOSUB440
  21. 260 GOTO220
  22. 270 CC=CC-24
  23. 280 CX=0
  24. 290 CC=C+(Y*II):NEXT
  25. 300 INPUT"[159]PLOT <Y/N> ";P$
  26. 310 IFP$="N"THEN130
  27. 320 IFP$="Y"THENGOSUB680:GOTO340
  28. 330 GOTO300
  29. 340 PRINT"E[146] TO END"
  30. 350 PRINT"R[146] TO RUN"
  31. 360 GETA$:IFA$="R"THENGOTO130
  32. 370 IFA$<>"E"THEN360
  33. 380 PRINT"[147]":END
  34. 390 PRINT"[147]":POKE53280,0:POKE53281,0
  35. 400 FORJ=0TO20:FORR=0TO23
  36. 410 POKES+R+(J*40),160:POKEC+R+(J*40),11
  37. 420 NEXT:NEXT
  38. 430 RETURN
  39. 440 CC=CC+XC
  40. 450 BC=BC+1
  41. 460 RETURN
  42. 470 FORP=0TOXC-1
  43. 480 POKECC+P,4
  44. 490 NEXT
  45. 500 CC=CC+XC
  46. 510 BC=BC+1
  47. 520 RETURN
  48. 530 DATA162,24,169,0,157,87,64,202,208,250,172,82,64,177,251,42,176
  49. 540 DATA47,141,86,64,169,0,205,83,64,240,1,232,141,83,64,254,87
  50. 550 DATA64,173,86,64,206,84,64,208,228,169,8,141,84,64,238,82,64
  51. 560 DATA172,82,64,206,85,64,208,210,169,3,141,85,64,96,141,86,64
  52. 570 DATA169,1,205,83,64,240,1,232,141,83,64,76,32,64,0,1,8
  53. 580 DATA3,0,0,0,2
  54. 590 POKE53280,6:POKE53281,6:PRINT"[147]":SN$=""
  55. 595 PRINT"1520 SPRITE PLOTTER"
  56. 600 INPUT"[158]ENTER SCALE OF PLOT (1-20)";SZ
  57. 610 IF(SZ<1)OR(SZ>20)THEN590
  58. 620 INPUT"ENTER SPRITE NUMBER";SN$
  59. 630 IFSN$<>""THEN670
  60. 640 INPUT"ENTER START ADDRESS";SA$
  61. 650 IFSA$=""THEN620
  62. 660 SA=VAL(SA$):RETURN
  63. 670 SN=VAL(SN$):SA=(SN*64):RETURN
  64. 680 OPEN4,6:PRINT#4,"SCALE=";SZ:PRINT#4:CLOSE4
  65. 690 OPEN1,6,1:PRINT#1,"H":POKECS,0
  66. 700 FORJ=1TO21:POKE16467,3:SYS16384:FORG=1TOSZ:BC=16471
  67. 710 IFPEEK(BC)=0THENBC=BC+1:XC=PEEK(BC):GOSUB820
  68. 720 XC=PEEK(BC):IFXC=0THEN770
  69. 730 GOSUB830
  70. 740 XC=PEEK(BC):IFXC=0THEN770
  71. 750 GOSUB820
  72. 760 GOTO720
  73. 770 PRINT#1,"I":PRINT#1,"R",-CX,YY:PRINT#1,"I"
  74. 780 YY=-(YY+1):PRINT#1,"R",0,YY:CX=0
  75. 790 NEXT:NEXT
  76. 800 PRINT#1:CLOSE1
  77. 810 RETURN
  78. 820 CX=CX+(XC*SZ):BC=BC+1:PRINT#1,"R",CX,YY:RETURN
  79. 830 CX=CX+(XC*SZ):BC=BC+1:PRINT#1,"J",CX,YY:RETURN
  80.